package com.qing.design.patterns.bridge.example;

import com.qing.design.patterns.bridge.example.devices.Device;
import com.qing.design.patterns.bridge.example.devices.Radio;
import com.qing.design.patterns.bridge.example.devices.Tv;
import com.qing.design.patterns.bridge.example.remotes.AdvancedRemote;
import com.qing.design.patterns.bridge.example.remotes.BasicRemote;

public class Demo {
	public static void main(String[] args) {
		testDevice(new Tv());
//		testDevice(new Radio());

	}

	public static void testDevice(Device device){
		System.out.println("基本远程测试。");
		BasicRemote basicRemote=new BasicRemote(device);
		basicRemote.power();
		device.printStatus();



		System.out.println("使用高级遥控器进行测试。");
		AdvancedRemote advancedRemote=new AdvancedRemote(device);
		advancedRemote.power();
		advancedRemote.mute();
		device.printStatus();
	}
}
